package com.acando.mate;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class NewsAdapter extends ArrayAdapter<String>{
private static final String LOREM="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea";
	private final Context context;
	  private final String[] values;

	  public NewsAdapter(Context context, String[] values) {
	    super(context, R.layout.news_item, values);
	    this.context = context;
	    this.values = values;
	  }

	  @Override
	  public View getView(int position, View convertView, ViewGroup parent) {
	    LayoutInflater inflater = (LayoutInflater) context
	        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	    View rowView = inflater.inflate(R.layout.news_item, parent, false);
	    TextView headlineTextView = (TextView) rowView.findViewById(R.id.news_headline);
	    TextView contentTextView = (TextView) rowView.findViewById(R.id.news_content);
	    headlineTextView.setText(values[position]);
	    contentTextView.setText(LOREM);
	    return rowView;
	  }
	  
	  
	
	
}
